package easy;

/**
 * @author admin
 * 461. 汉明距离
 * 解题思路：bitcount：统计二进制数中1的个数，1的个数即为答案;换而言之，先异或求出结果，再求出1的个数
 */
public class LeeCode461 {

    public int hammingDistance(int x, int y) {

        return Integer.bitCount(x ^ y);
    }

    public static void main(String[] args) {
        System.out.println(new LeeCode461().hammingDistance(1, 3));
    }
}
